/****** Object:  Table [dbo].[Video_Album]    Script Date: 01/09/2013 23:38:00 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Video_Album](
	[AlbumID] [int] IDENTITY(1,1) NOT NULL,
	[AlbumParentID] [int] NULL,
	[AlbumAvatar] [nvarchar](250) NULL,
	[AlbumName] [nvarchar](200) NULL,
	[AlbumDetail] [ntext] NULL,
	[CreateUserID] [int] NULL,
	[ModifyUserID] [int] NULL,
	[CreateDate] [datetime] NULL,
	[ModifiedDate] [datetime] NULL,
	[Visible] [bit] NULL,
	[IsComment] [bit] NULL,
	[Indexs] [int] NULL,
	[PortalID] [int] NULL,
	[Lang] [varchar](50) NULL,
	[Other_ID] [int] NULL,
	[Rank] [int] NULL,
 CONSTRAINT [PK_Video_Album] PRIMARY KEY CLUSTERED 
(
	[AlbumID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[Video_Album] ADD  CONSTRAINT [DF_Video_Album_CreateDate]  DEFAULT (getdate()) FOR [CreateDate]
GO

ALTER TABLE [dbo].[Video_Album] ADD  CONSTRAINT [DF_Video_Album_ModifiedDate]  DEFAULT (getdate()) FOR [ModifiedDate]
GO

ALTER TABLE [dbo].[Video_Album] ADD  CONSTRAINT [DF_Video_Album_Visible]  DEFAULT ((0)) FOR [Visible]
GO

ALTER TABLE [dbo].[Video_Album] ADD  CONSTRAINT [DF_Video_Album_Indexs]  DEFAULT ((0)) FOR [Indexs]
GO

ALTER TABLE [dbo].[Video_Album] ADD  CONSTRAINT [DF_Video_Album_Content_ID]  DEFAULT ((0)) FOR [Other_ID]
GO

ALTER TABLE [dbo].[Video_Album] ADD  CONSTRAINT [DF_Video_Album_Rank]  DEFAULT ((0)) FOR [Rank]
GO

/****** Object:  Table [dbo].[Gallery_Picture]    Script Date: 01/09/2013 23:40:23 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Video_Clip](
	[ClipID] [int] IDENTITY(1,1) NOT NULL,
	[ClipName] [nvarchar](250) NULL,
	[ClipAvatar] [varchar](250) NULL,
	[ClipFile] [varchar](250) NULL,
	[ClipDetail] [ntext] NULL,
	[ClipIndex] [int] NULL,
	[ClipVisible] [bit] NULL,
	[CreateDate] [datetime] NULL,
	[ModifiedDate] [datetime] NULL,
	[CreateUserID] [int] NULL,
	[ModifyUserID] [int] NULL,
	[AlbumID] [int] NULL,
	[PortalID] [int] NULL,
 CONSTRAINT [PK_Video_Clip] PRIMARY KEY CLUSTERED 
(
	[ClipID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[Video_Clip]  WITH CHECK ADD  CONSTRAINT [FK_Video_Clip_Video_Album] FOREIGN KEY([AlbumID])
REFERENCES [dbo].[Video_Album] ([AlbumID])
ON DELETE CASCADE
GO

ALTER TABLE [dbo].[Video_Clip] CHECK CONSTRAINT [FK_Video_Clip_Video_Album]
GO

ALTER TABLE [dbo].[Video_Clip] ADD  CONSTRAINT [DF_Video_Clip_CreateDate]  DEFAULT (getdate()) FOR [CreateDate]
GO

ALTER TABLE [dbo].[Video_Clip] ADD  CONSTRAINT [DF_Video_Clip_ModifiedDate]  DEFAULT (getdate()) FOR [ModifiedDate]
GO

